using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

using MicroFractal.iTunesBrowser.Core.Data.ITunesDB.Item;

namespace MicroFractal.iTunesBrowser.Core.Data.ITunesDB.ItemList
{
    public class AlbumItemList : ItemList
    {

        #region Constructors

        public AlbumItemList(MemoryStream data)
            : base(data)
        {
            base.Items = new List<DataItem>();
            int len = 0;
            int oldLen = 0;
            for (int i = 0; i < base.Count; i++)
            {
                oldLen += len;
                len = Helper.ITunesHelper.BytesToInt(data, base.Length + 8 + oldLen, 4);
                DataItem it = new AlbumItem(Helper.ITunesHelper.GetMemoryStream(data, base.Length + oldLen, len));
                base.Items.Add(it);
            }
        }

        #endregion
    }
}
